﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.IO;

namespace PPIDesktopClient.Entities.Xml
{
    public class EOutbox
    {
        #region Private Properties
        private string m_ConnectionString;
        private string m_Id;
        private bool m_IsDataUploaded;
        private DateTime m_FinishedDataDate;
        private DateTime m_FinishedImagesDate;
        private bool m_IsImagesUploaded;
        private string m_Path;
        private bool m_OpenedDatabase;
        private bool m_isToUpload;
        private FileInfo m_DatabaseFile;


        #endregion

        #region Public Properties
        public string ConnectionString
        {
            get
            {
                return m_ConnectionString;
            }
            set
            {
                m_ConnectionString = value;
            }
        }
        public string Id
        {
            get
            {
                return m_Id;
            }
            set
            {
                m_Id = value;
            }
        }
        public bool IsDataUploaded
        {
            get
            {
                return m_IsDataUploaded;
            }
            set
            {
                m_IsDataUploaded = value;
            }
        }
        public DateTime FinishedDate
        {
            get
            {
                return m_FinishedDataDate;
            }
            set
            {
                m_FinishedDataDate = value;
            }
        }
        public DateTime FinishedImagesDate
        {
            get
            {
                return m_FinishedImagesDate;
            }
            set
            {
                m_FinishedImagesDate = value;
            }
        }
        public bool IsImagesUploaded
        {
            get
            {
                return m_IsImagesUploaded;
            }
            set
            {
                m_IsImagesUploaded = value;
            }
        }
        public string MobilePath
        {
            get
            {
                return m_Path;
            }
            set
            {
                m_Path = value;
            }
        }
        public bool IsOpenedDatabase
        {
            get
            {
                return m_OpenedDatabase;
            }
            set
            {
                m_OpenedDatabase = value;
            }
        }
        public bool Upload
        {
            get
            {
                return m_isToUpload;
            }
            set
            {
                m_isToUpload = value;
            }
        }
        public DateTime  Created 
        {
            get { return new FileInfo(ConnectionString).CreationTime;}
        }


        #endregion

        #region Constructor

        public EOutbox()
        {
            m_isToUpload = false;
        }

        public EOutbox(string connectionString, string id, string path, bool isDataUploaded, bool isImagesUploaded, DateTime dataFinished, bool IsOpenedDatabase)
            : this()
        {
            m_ConnectionString = connectionString;
            m_Id = id;
            m_Path = path;
            m_IsDataUploaded = isDataUploaded;
            m_IsImagesUploaded = isImagesUploaded;
            m_FinishedDataDate = dataFinished;
            m_OpenedDatabase = IsOpenedDatabase;
            
        }

        #endregion



    }
}
